package com.sword.demo.quartz.service;

import org.quartz.SchedulerException;

import java.lang.reflect.InvocationTargetException;

/**
 * 定时任务-服务
 * @author sword
 * @date 2022/11/28 17:24
 */
public interface SchedulerService {

    /**
     * 手动执行指定定时任务详情
     *
     * @param jobDetailId 任务详情id
     * @throws InvocationTargetException 执行目标方法异常
     * @throws IllegalAccessException 非法访问异常
     * @author sword
     * @date 2022/11/28 17:25
     */
    void invokeJobDetail(String jobDetailId) throws InvocationTargetException, IllegalAccessException;

    /**
     * 启动定时任务
     *
     * @throws SchedulerException 定时问题异常
     * @author sword
     * @date 2022/11/28 17:25
     */
    void start() throws SchedulerException;

    /**
     * 暂停定时任务，可以重新启动
     *
     * @throws SchedulerException 定时问题异常
     * @author sword
     * @date 2022/11/28 17:25
     */
    void standby() throws SchedulerException;

    /**
     * 关闭定时任务，无法重新启动
     *
     * @throws SchedulerException 定时问题异常
     * @author sword
     * @date 2022/11/28 17:25
     */
    void shutdown() throws SchedulerException;
}
